﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pipes.Queries.Model.Pattern
{
  public class Pattern : Parser.IPatternVisitable
  {
    private List<IMatch> _matches = new List<IMatch>();

    public IList<IMatch> Matches
    {
      get 
      {
        return _matches;
      }
    }

    public override string ToString()
    {
      var builder = new StringBuilder();
      foreach (var match in _matches)
      {
        builder.Append(match.ToString());
      }
      return builder.ToString();
    }

    public void Visit(Parser.IPatternVisitor visitor)
    {
      visitor.Visit(this);
    }
  }
}
